GBML manual / Drawing

draw_effect_start

Every picture and bar drawn from here until draw_effect_stop wears a sprite effect: draw_sprite, draw_rect_fill and draw_rect in a HUD or a menu pulse, wobble, tint or turn the way an object would. It is ambient, like text_effect_start is for words. Call it every frame, in a Draw GUI event or in a script one calls, before the draw calls it should reach.

Works differently on Game Boy - Pictures drawn between draw_effect_start and draw_effect_stop wear the sprite effect as sprite_effect_start plays it here. A bar or box (draw_rect, draw_rect_fill) wears only its Tint, and only when a sprite palette is free. Up to 8 effects at once.

Works differently on Game Boy Color - Pictures drawn between draw_effect_start and draw_effect_stop wear the sprite effect as sprite_effect_start plays it here. A bar or box (draw_rect, draw_rect_fill) wears only its Tint, and only when a sprite palette is free. Up to 8 effects at once.

Sega Genesis: not built yet - The Sega Genesis will draw effects its own way.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

draw_effect_start(effect)

Arguments

NameType
effectoverlay

Returns

Nothing.

Description

Every picture and bar drawn from here until draw_effect_stop wears a sprite effect: draw_sprite, draw_rect_fill and draw_rect in a HUD or a menu can pulse, wobble, tint or turn the way an object does. A sprite effect is made in the Overlay Effects tab, like the one sprite_effect_start plays on an object.

It is ambient, the same shape text_effect_start has for words: you choose it once and every picture drawn after it wears it. Call it every frame, in a Draw GUI event or in a script one calls, before the draw calls it should reach. The HUD & Menus designer writes these two calls for you when a Bar, a Sprite or a Row of icons is given an Effect.

Example

draw_effect_start(se_doc_hit);
draw_sprite(spr_doc_glow, 16, 8, 0);
draw_effect_stop();
draw_sprite(spr_doc_glow, 40, 8, 0);

The first picture flashes. The second is drawn with the very same sprite and keeps its own colors.

What a picture wears

A picture wears everything the effect has: Tint, Wobble, Distort, Scale, Rotate, and the marks of Blocks and See-through. They work as they do for an object that starts the effect in its own Draw event (see sprite_effect_start).

A bar (draw_rect_fill, draw_rect) wears only the effect's Tint: its size is its fill, and a big bar is made of several small sprites.

The clock

The effect plays on the object that calls the script. Its clock goes on from one frame to the next: the next frame's draw_effect_start does not begin it again. A pulse that plays once plays once, and then the pictures are drawn as they always were.

Two effects started in turn (a bar in one, a row of icons in another) each keep a clock and a place of their own. Every different effect a HUD draws with takes one of the places the game keeps for sprite effects playing at once (up to 8 for the whole game).

On a console

The effect needs the console's blend, row-by-row effects and sprite scaling; on a console without them the choice is grayed out.

On the GBA

It is the sprite effect an object starts in its own Draw event, asked for by name so a script can start it: the effect plays on the object that calls the script, on a clock that goes on from one frame to the next (the start of the next frame does not begin it again). Pictures wear all of it: Tint (a place of the console’s 16 sprite palettes while the amount is not 0), Wobble and Distort (row-by-row effects, up to 6 pictures at a time for each effect), Scale and Rotate, and the marks of Blocks and See-through. A bar (draw_rect_fill, draw_rect) wears only the Tint: its size is its fill, and a big bar is made of several small sprites. Two effects started in turn (a bar in one, a row of icons in another) each keep a clock and a place of their own, and the place of each counts as one of the sprite effects that can play at once.

See also: Overlay effects - screen effects you make yourselfdraw_effect_stopsprite_effect_starttext_effect_startdraw_spritedraw_rect_filldraw_rect